#pragma once

#include <memory>
#include "ft2build.h"
#include FT_FREETYPE_H
#include FT_CACHE_H

#include "TrueText/FontEffectOutline.h"
#include "TrueText/FontEffectShadow.h"
#include "TrueText/Types.h"
#include <boost/smart_ptr/shared_ptr.hpp>

namespace TrueText {

class FaceImpl;
class FontEffect;
struct FaceId;

class FontImpl
{
public:
    FontImpl(boost::shared_ptr<FaceImpl> face, float height);
    FontImpl(const FontImpl& rhs);
    const FontImpl& operator=(const FontImpl& rhs);
	~FontImpl();

    float GetHeight() const
    {
        return height;
    }

	void SetHeight(float value);

    // Returns height of a single line of text drawn with this font.
    float GetLineHeight() const;
    FT_Size getSize();
	FTC_ScalerRec getScaler();
	FaceId* getFaceId();

	const Color& GetColor() const;
	void SetColor(const Color& value);

	FontEffectOutline& Outline();
	FontEffectShadow& Shadow();
private:
	void cleanupFtSize();
    void rebuildFtSize();

    float height;
    FT_Size ftsize;
	Color color;
    // Reference to Face representation.
    boost::shared_ptr<FaceImpl> face;
	FontEffectOutline outline;
	FontEffectShadow shadow;
};

}